package com.n9.product.web.vo;

import com.n9.base.web.vo.IdVO;
import com.n9.product.entity.PatentType;
import com.n9.product.entity.SaleStatus;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 专利产品VO
 *
 * @author xqlu
 * @version 2019-01-23
 */
@Getter
@Setter
public class PatentVO extends IdVO {
    private static final long serialVersionUID = 1L;
    @NotBlank(message = "专利号不能为空")
    @Length(max = 16, message = "专利号长度不正确")
    private String no;
    private PatentType type;
    private SaleStatus saleStatus;
    @NotBlank(message = "专利状态不能为空")
    private String status;
    @NotBlank(message = "缴费截止日志不能为空")
    private String expireDate;
    private String digest;
    @NotBlank(message = "产品名称不能为空")
    @Length(max = 255, message = "产品名称长度不正确")
    private String name;
    @NotNull(message = "价格不能为空")
    @Pattern(regexp = "(^[1-9](\\d+)?(\\.\\d{1,2})?$)|(^0$)|(^\\d\\.\\d{1,2}$)", message = "金额格式错误")
    private String price;
    private String[] tagNames;
    private Integer priority;
    private String providerId;
    private String providerName;
    private Integer tagCount;
    private String notes;
}
